.class Lcom/xingbook/c/d;
.super Ljava/lang/Object;

# interfaces
.implements Lcom/xingbook/park/ui/g;


# instance fields
.field private final synthetic a:Landroid/app/Activity;


# direct methods
.method constructor <init>(Landroid/app/Activity;)V
    .locals 0

    iput-object p1, p0, Lcom/xingbook/c/d;->a:Landroid/app/Activity;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public a()V
    .locals 5

    iget-object v0, p0, Lcom/xingbook/c/d;->a:Landroid/app/Activity;

    new-instance v1, Landroid/content/Intent;

    const-string v2, "com.111.xingpark.ting.play.musicservice.action.STOP"

    invoke-direct {v1, v2}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0, v1}, Landroid/app/Activity;->startService(Landroid/content/Intent;)Landroid/content/ComponentName;

    iget-object v0, p0, Lcom/xingbook/c/d;->a:Landroid/app/Activity;

    invoke-virtual {v0}, Landroid/app/Activity;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    invoke-static {v0}, Lcom/xingbook/c/n;->a(Landroid/content/Context;)Lcom/xingbook/c/n;

    move-result-object v0

    invoke-virtual {v0}, Lcom/xingbook/c/n;->g()Lcom/xingbook/park/d/e;

    move-result-object v1

    iget-object v0, p0, Lcom/xingbook/c/d;->a:Landroid/app/Activity;

    invoke-virtual {v0}, Landroid/app/Activity;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    invoke-static {v0}, Lcom/xingbook/c/n;->a(Landroid/content/Context;)Lcom/xingbook/c/n;

    move-result-object v0

    invoke-virtual {v0}, Lcom/xingbook/c/n;->j()Lcom/xingbook/service/download/b;

    move-result-object v0

    invoke-virtual {v0}, Lcom/xingbook/service/download/b;->g()Ljava/util/ArrayList;

    move-result-object v0

    if-eqz v0, :cond_0

    invoke-virtual {v0}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v2

    :goto_0
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-nez v0, :cond_2

    :cond_0
    iget-object v0, p0, Lcom/xingbook/c/d;->a:Landroid/app/Activity;

    invoke-virtual {v0}, Landroid/app/Activity;->finish()V

    iget-object v0, p0, Lcom/xingbook/c/d;->a:Landroid/app/Activity;

    instance-of v0, v0, Lcom/xingbook/park/activity/HomeActivity;

    if-nez v0, :cond_1

    invoke-static {}, Lcom/xingbook/park/activity/HomeActivity;->a()Landroid/app/Activity;

    move-result-object v0

    if-eqz v0, :cond_1

    invoke-virtual {v0}, Landroid/app/Activity;->finish()V

    :cond_1
    return-void

    :cond_2
    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/xingbook/service/download/k;

    invoke-virtual {v0}, Lcom/xingbook/service/download/k;->a()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v0}, Lcom/xingbook/service/download/k;->g()I

    move-result v0

    const/4 v4, 0x4

    invoke-virtual {v1, v3, v0, v4}, Lcom/xingbook/park/d/e;->a(Ljava/lang/String;II)V

    goto :goto_0
.end method

.method public b()V
    .locals 5

    iget-object v0, p0, Lcom/xingbook/c/d;->a:Landroid/app/Activity;

    invoke-virtual {v0}, Landroid/app/Activity;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    invoke-static {v0}, Lcom/xingbook/c/n;->a(Landroid/content/Context;)Lcom/xingbook/c/n;

    move-result-object v0

    invoke-virtual {v0}, Lcom/xingbook/c/n;->g()Lcom/xingbook/park/d/e;

    move-result-object v1

    iget-object v0, p0, Lcom/xingbook/c/d;->a:Landroid/app/Activity;

    invoke-virtual {v0}, Landroid/app/Activity;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    invoke-static {v0}, Lcom/xingbook/c/n;->a(Landroid/content/Context;)Lcom/xingbook/c/n;

    move-result-object v0

    invoke-virtual {v0}, Lcom/xingbook/c/n;->j()Lcom/xingbook/service/download/b;

    move-result-object v0

    invoke-virtual {v0}, Lcom/xingbook/service/download/b;->g()Ljava/util/ArrayList;

    move-result-object v0

    if-eqz v0, :cond_0

    invoke-virtual {v0}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v2

    :goto_0
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-nez v0, :cond_2

    :cond_0
    iget-object v0, p0, Lcom/xingbook/c/d;->a:Landroid/app/Activity;

    invoke-virtual {v0}, Landroid/app/Activity;->finish()V

    iget-object v0, p0, Lcom/xingbook/c/d;->a:Landroid/app/Activity;

    instance-of v0, v0, Lcom/xingbook/park/activity/HomeActivity;

    if-nez v0, :cond_1

    invoke-static {}, Lcom/xingbook/park/activity/HomeActivity;->a()Landroid/app/Activity;

    move-result-object v0

    if-eqz v0, :cond_1

    invoke-virtual {v0}, Landroid/app/Activity;->finish()V

    :cond_1
    return-void

    :cond_2
    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/xingbook/service/download/k;

    invoke-virtual {v0}, Lcom/xingbook/service/download/k;->a()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v0}, Lcom/xingbook/service/download/k;->g()I

    move-result v0

    const/4 v4, 0x4

    invoke-virtual {v1, v3, v0, v4}, Lcom/xingbook/park/d/e;->a(Ljava/lang/String;II)V

    goto :goto_0
.end method
